import request from './requests.js'
import {
	select_sku_attribute_url
} from "./setting.js"

import {
	Toast
} from 'vant'



export function get_sku_attribute(callBack, sku_id) {


		request({
			method: 'GET',
			url: select_sku_attribute_url,
			params: {
				sku_id: sku_id
			}
		}).then((response) => { //这里使用了ES6的语法
			// console.log(response) //请求成功返回的数据
			let result = response.data.resultBody.reverse()
			// console.log(result)
			callBack(result)
	
		}).catch((error) => {
			console.log(error) //请求失败返回的数据
			Toast('联系管理员！！')
		})
	
}

export default get_sku_attribute